home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 1 / 001.d81 / dynamic renew.b (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  98 lines

  1. 1000 :
  2. 1010 rem  dynamic renewing program
  3. 1020 rem  t.s. creasy september 1983
  4. 1030 :
  5. 1040 rem  instructions
  6. 1050 :
  7. 1051 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]":print"[221]dynamic renew disk [221]"
  8. 1052 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  9. 1053 forx=1to1000:next
  10. 1060 print"this program modifies":print"itself by the dynamic"
  11. 1070 print"keyboard technique.":print"once modified, it "
  12. 1080 print"cannot be used with ":print"any disk except the one"
  13. 1090 print"it was modified for.":print"during the dynamic"
  14. 1100 print"modification the screen":print"will flash with"
  15. 1110 print"the new program lines":open50,0:print"press return":input#50,k$:close50
  16. 2000 :
  17. 2010 rem attach data statements
  18. 2020 rem of tracks and sectors
  19. 2030 :
  20. 2032 print"[147]5 data"peek(822)
  21. 2033 print"goto2050"
  22. 2034 poke631,13:poke632,13:rem poke carriage returns into k buffer
  23. 2035 poke198,2:rem number of returns
  24. 2036 stop
  25. 2050 i=0:ln=10:j=peek(822)
  26. 2060 print"[147]"(ln+i)"data"peek(823+i)","peek(823+i+j)
  27. 2070 print"goto2120"
  28. 2080 poke631,13:poke632,13:rem poke carriage returns into k buffer
  29. 2090 poke198,2:rem number of returns
  30. 2100 poke820,i:rem save i in c buffer
  31. 2105 poke821,ln:rem save ln in c buffer
  32. 2110 stop
  33. 2120 i=peek(820)+1:ln=peek(821)+1:j=peek(822)
  34. 2130 if i<peek(822)then2060
  35. 3000 :
  36. 3010 rem force skip to validate
  37. 3020 rem portion of the program
  38. 3030 :
  39. 3040 print"[147]1 goto 4000":print"goto6000"
  40. 3060 poke631,13:poke632,13:rem poke carriage return into k buffer
  41. 3080 poke198,2:rem number of returns
  42. 3090 stop
  43. 4000 :
  44. 4010 rem new disk with operator
  45. 4020 rem interaction
  46. 4030 :
  47. 4040 print"[147][176][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][174]"
  48. 4050 print"[209] renew disk        [209]"
  49. 4060 print"[209] bad sectors       [209]"
  50. 4070 print"[173][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][189]"
  51. 4080 print"insert disk in drive":print"press return"
  52. 4090 open50,0:input#50,k$:close50
  53. 4100 print"initializing disk"
  54. 4110 open15,8,15,"i":input#15,e,m$,tr,se
  55. 4115 open5,8,5,"#": rem open buffer
  56. 4120 ife<>0thenprint"disk error#"e:end
  57. 4130 print#15,"b-r:"5;0;18;0:rem place disk header in buffer #
  58. 4140 print#15,"b-p:"5;144:rem set pointer to disk name
  59. 4150 d$="":forx=144to166:get#5,k$:d$=d$+(chr$(0)+k$):next:rem disk name
  60. 4160 print"disk name:":print""d$
  61. 4170 input"renew disk (erasing all files)[146]  n[146][157][157][157]";k$
  62. 4180 ifk$<>"y"thenclose5:close15:end
  63. 4190 input"enter new name";k$
  64. 4200 print"name:"k$:input"is name correct  y[146][157][157][157]";a$
  65. 4210 ifa$<>"y"then4190
  66. 4220 print#15,"n0:"k$:print"newing disk"
  67. 4998 close5:close15
  68. 5000 :
  69. 5010 rem allocate bad blocks
  70. 5020 :
  71. 5030 open15,8,15,"v":print"[147]validating the disk"
  72. 5040 open2,8,2,"#"
  73. 5050 print"[147]   bad blocks":print"track","sector"
  74. 5060 read j:i=0
  75. 5070 read tr,se
  76. 5080 print#15,"b-a:";0;tr;se
  77. 5090 printtr,se
  78. 5100 i=i+1:if i=j then 5120
  79. 5110 goto5070
  80. 5120 forx=1to3000:next
  81. 5130 print"[147]"j"bad sectors have":print"been removed from use."
  82. 5140 print"do not validate  ":print"data may be lost!"
  83. 5150 close15
  84. 5160 forx=1to1000:next
  85. 6000 :
  86. 6010 rem save self to disk
  87. 6020 :
  88. 6030 print"[147]place disk with bad":print"blocks in drive"
  89. 6040 open50,0:print"press return":input#50,k$
  90. 6050 print"saving this program"
  91. 6060 save"@0:renew this disk",8
  92. 6080 print"[147]never validate this":print"disk. copy files to ":print"another disk, then"
  93. 6090 print"load and run this":print"program to renew the":print"disk with automatic"
  94. 6100 print"'bad sector' handling.":print"never validate this disk"
  95. 6110 print"this program has been":print"modified for this":print"disk only"
  96. 6120 print"do not use this     ":print"program with another":print"disk::::            "
  97. 7110 print"the disk is prepared"
  98.